Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pidusage

Package Overview
Dependencies
Maintainers
4
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pidusage

Cross-platform process cpu % and memory usage of a PID

  • 3.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3M
increased by5.22%
Maintainers
4
Weekly downloads
 
Created

What is pidusage?

The pidusage npm package is a cross-platform process and system monitoring library. It provides statistics such as CPU usage, memory usage, running time, and more for a given process ID (PID). It's particularly useful for monitoring the resource consumption of processes in Node.js applications.

What are pidusage's main functionalities?

Process Statistics

This feature allows you to monitor the resource usage of a specific process. The code sample demonstrates how to get statistics such as CPU and memory usage for the current process.

const pidusage = require('pidusage');
pidusage(process.pid, function (err, stats) {
  console.log(stats);
});

Monitoring Multiple PIDs

Pidusage also supports monitoring multiple processes at once. This code sample shows how to get statistics for multiple PIDs simultaneously.

const pidusage = require('pidusage');
pidusage([1234, 5678], function (err, stats) {
  console.log(stats);
});

Other packages similar to pidusage

Keywords

FAQs

Package last updated on 25 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc